using System;
using UnityEngine;
using QFramework;
using UnityEngine.UI;

namespace ProjectMyFarmAndShe
{
	public partial class ShopPanel : ViewController,IController
	{
		void Start()
		{
			ShopBuyItemPanel.Hide();
			ShopSellItemPanel.Hide();
			
			// Code Here
			BtnClose.onClick.AddListener(() =>
			{
				UIGameController.Default.CloseShopPanel();
				Global.OpenPanel.Value = false;
				ShopBuyItemPanel.Hide();
				ShopSellItemPanel.Hide();
			});
		}

		public void OpenShopBuyItemPanel()
		{
			Global.OpenPanel.Value = true;
			ContentText.text = "你需要点什么商品?";
			ShopBuyItemPanel.Show();
		}

		public void OpenShopSellItemPanel()
		{
			Global.OpenPanel.Value = true;
			ContentText.text = "感谢您将物品出售给我,我会以最好的价格收购。";
			ShopSellItemPanel.Show();
		}

		public IArchitecture GetArchitecture()
		{
			return Global.Interface;
		}
	}
}
